Doors DXL

We recently moved our SVN (source code versioning system) to a new server (location). Unfortunately we had given direct external links from our design modules in Doors to the SVN path in the source files. Now all these paths are wrong. Is there a way to search and replace all the links to the new path?
Nikhitha
jaguar - Tue Dec 04 05:08:56 EST 2012

Re: Doors DXL
Tony_Goodman - Wed Dec 05 06:16:54 EST 2012

This will do that for you.

I just wrote this quickly so make sure you test it on a scratch module first!
 

pragma runLim, 0
 
DB dbMain = null
DBE dbeOld = null
DBE dbeNew = null
 
 
string oldString = ""
string newString = ""
 
Module m = current Module
 
Buffer b = create
 
void doApply(DB db)
{
    Object o = null
        ExternalLink el = null
        string elBody = ""
        
        oldString = get(dbeOld)
        newString = get(dbeNew)
        
        for o in m do
        {
                for el in o -> "*" do
                {
                        setempty(b)
                        
                        b += body(el)
                        
                        i = contains(b, oldString, 0)
                        
                        print i "\n"
                        
                        if (i == 0)
                        {
                                elBody = newString b[i + length(oldString):]
                        }
                        else if (i > 0)
                        {
                                elBody = b[0:i-1] newString b[i + length(oldString):]
                        }
                        else
                        {
                                continue
                        }
                        
                        update(description(el), name(el), direction(el), behaviour(el), elBody, el)
 
                }
        }
}
 
 
/******************************************************************************
        MAIN
******************************************************************************/
dbMain = create(m, "Update External Links", styleFloating)
 
label(dbMain, "")
 
dbeOld = field(dbMain, "Old String", oldString, 20, false)
dbeNew = field(dbMain, "New String", newString, 20, false)
 
ok(dbMain, "OK", doApply)
 
realize(dbMain)
 
show(dbMain)

 


Tony Goodman, www.smartdxl.com

 

Re: Doors DXL
jaguar - Tue Dec 11 05:10:10 EST 2012

Hi Tony,

Thank you so.... much.
Your solution is working.really .it can value add
Nikhitha